﻿namespace ProjectIndieFarm
{
    public class PowerUpGroupRipePercent
    {
        public static void Setup(IPowerUpSystem system)
        {
            var ripeCount1 = system.Add(new PowerUp()
                .SetKey("plant_ripe_percent_lv1")
                .SetTitle("存活率提升Lv1")
                .SetPrice(3200)
                .SetDescription("农作物存活率提升5%")
                .OnUnlock(self =>
                {
                    Global.PlantRipePercentScale = 0.05f;
                    self.SendMessageWithEffect("农作物存活率提高了");
                }));
            var ripeCount2 = system.Add(new PowerUp()
                .SetKey("plant_ripe_percent_lv2")
                .SetTitle("存活率提升Lv2")
                .SetPrice(6000)
                .SetDescription("农作物存活率提升5%")
                .ShowCondition(_=>ripeCount1.Unlocked)
                .OnUnlock(self =>
                {
                    Global.PlantRipePercentScale = 0.05f;
                    self.SendMessageWithEffect("农作物存活率提高了");
                }));
            var ripeCount3 = system.Add(new PowerUp()
                .SetKey("plant_ripe_percent_lv3")
                .SetTitle("存活率提升Lv3")
                .SetPrice(10000)
                .SetDescription("农作物存活率提升5%")
                .ShowCondition(_ => ripeCount2.Unlocked)
                .OnUnlock(self =>
                {
                    Global.PlantRipePercentScale = 0.05f;
                    self.SendMessageWithEffect("农作物存活率提高了");
                }));
            var ripeCount4 = system.Add(new PowerUp()
                .SetKey("plant_ripe_percent_lv4")
                .SetTitle("存活率提升Lv4")
                .SetPrice(16000)
                .SetDescription("农作物存活率提升5%")
                .ShowCondition(_ => ripeCount3.Unlocked)
                .OnUnlock(self =>
                {
                    Global.PlantRipePercentScale = 0.05f;
                    self.SendMessageWithEffect("农作物存活率提高了");
                }));

        }
    }
}
